package base.thread_JUC2.chapter01.demo003;

import java.time.Instant;
import java.util.concurrent.TimeUnit;

public class TestCase {
    public static void main(String[] args) {
        PrimeGenerator task = new PrimeGenerator();
        task.start();

        // Wait 5 seconds
        try {
            TimeUnit.SECONDS.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // 调用打断方法，打断线程
        task.interrupt();

    }
}
